#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int M = 40;
const int N = 30;
const int MOD = 1e9 + 7;
const ll INF = 1e18 + 50;
ll a, b, n;
int main()
{
    int t;
    scanf("%d", &t);
    while (t--)
    {
        scanf("%lld %lld %lld", &n, &a, &b);
        ll ans = INF;
        if (a * 3 <= b * 2)
        {
            ll num_2 = (n + 1) / 2;
            for (ll i = 0; i <= 3; i++)
            {
                ll cur_2 = num_2 - i;
                ll cur_3 = (n - cur_2 * 2 + 2) / 3;
                ans = min(ans, a * cur_2 + b * cur_3);
            }
        }
        else
        {
            ll num_3 = (n + 2) / 3;
            for (ll i = 0; i <= 2; i++)
            {
                ll cur_3 = num_3 - i;
                ll cur_2 = (n - cur_3 * 3 + 1) / 2;
                ans = min(ans, a * cur_2 + b * cur_3);
            }
        }
        printf("%lld\n", ans);
    }
    return 0;
}